<?php

namespace App\Models;


use Illuminate\Support\Facades\Storage;

class WechatUserModel extends BaseModel
{
    protected $table = 'wechat_user';

    // 查询后新增的字段
    protected $appends = ['vip_text'];

    public function getVipTextAttribute()
    {
        return $this->is_vip ? 'VIP用户' : '普通用户';
    }


    public function getHeadimgurlAttribute($value)
    {
        //设置访问路径
        return $value ? Storage::disk('public')->url($value) : '';
    }
}
